package com.clei.dto.file;

import com.clei.utils.FileUtil;

/**
 * 文件大小
 *
 * @author Y
 * @date 2023-10-07
 **/
public class FileSize {
    /**
     * 文件名
     */
    private final String name;

    /**
     * 文件全名 包含路径
     */
    private final String fullName;

    /**
     * 文件大小
     */
    private final long size;

    public String toString(String unit) {
        return FileUtil.getUnitString(size, unit) + name + '\t' + '\t' + fullName;
    }

    public FileSize(String name, String fullName, long size) {
        this.name = name;
        this.fullName = fullName;
        this.size = size;
    }

    public long getSize() {
        return size;
    }
}
